import java.util.*;

//23年OPPO-a的翻转

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int a = in.nextInt();
            int b=a;
            String c=String.valueOf(b);
            b=getnum(c);
            System.out.println(a+b);
        }

    }
    public static int getnum(String s){
        int sum=0;
        for(int i=s.length()-1;i>=0;i--){
            char c=s.charAt(i);
            sum=sum*10+(c-'0');
        }
        return sum;
    }


    //方法二:23年OPPO-a的翻转
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int a = in.nextInt();
            int b=a;
            String c=String.valueOf(b);
            StringBuffer rev=new StringBuffer(c);
            rev.reverse();
            int d=Integer.parseInt(rev.toString());
            System.out.println(a+d);
        }
    }


    //小美的因子查询
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int num=in.nextInt();
        for(int i=0;i<num;i++){
            int res=in.nextInt();
            if(res%2==0){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }
        // 注意 hasNext 和 hasNextLine 的区别

    }

    // 游游的整数切割
    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);
        String s=in.next();
        int num=0;
        for(int i=1;i<s.length();i++){
            String a=s.substring(i);
            String b=s.substring(0,i);
            if(isValid(a,b)){
                num++;
            }
        }
        System.out.println(num);
    }
    public static boolean isValid(String a,String b){
        char c1=a.charAt(a.length()-1);
        char c2=b.charAt(b.length()-1);
        int aa=c1-'0';
        int bb=c2-'0';
        return (aa+bb)%2==0;
    }


    //小欧的奇数
    public static void main4(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int a=in.nextInt();
        int num1=0;//奇数
        int num2=0;//偶数
        for(int i=0;i<a;i++){
            int b=in.nextInt();
            if(b%2==0){
                num2++;
            }else{
                num1++;
            }
        }
        if((num1>=1&&num2>=2)||(num1>=3&&num2==0)){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }


    //小红的字符串构造
    public static void main7(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();

        // 提取字符集
        Set<Character> charSet = new HashSet<>();
        for (char c : s.toCharArray()) {
            charSet.add(c);
        }

        // 如果字符集只有一个字符，无解
        if (charSet.size() == 1) {
            System.out.println(-1);
            return;
        }

        // 转换字符集为列表，方便索引操作
        List<Character> charList = new ArrayList<>(charSet);
        StringBuilder t = new StringBuilder();

        // 替换每个字符
        for (int i = 0; i < s.length(); i++) {
            char current = s.charAt(i);
            int index = charList.indexOf(current);
            // 确保选择不同的字符，循环选择下一个字符
            char replacement = charList.get((index + 1) % charList.size());
            t.append(replacement);
        }

        // 输出结果
        System.out.println(t.toString());
    }
}

